package com.vhly.ddxdecompiler.dexreader.file.constant;

import com.vhly.ddxdecompiler.dexreader.file.DexFile;
import com.vhly.ddxdecompiler.dexreader.file.StringIdsSection;
import com.vhly.ddxdecompiler.dexreader.file.mixeditem.StringIdItem;

/**
 * Created by IntelliJ IDEA.
 * User: vhly[FR]
 * Date: 2009-10-21
 * Time: 22:06:55
 * Platform: Mac OS X 10.5.8
 *
 * @author vhly[FR]
 */
public class CstString implements CstConstant{
    private int stringIdIndex;

    private StringIdItem string;

    public CstString(int index) {
        stringIdIndex = index;
    }

    public void reloc(DexFile dex) {
        StringIdsSection strings = dex.getStringIds();
        string = strings.indexOf(stringIdIndex);
    }

    public Object getJavaData() {
        return string.toString();
    }

    public String getJavaType() {
        return null;
    }
}
